home *** CD-ROM | disk | FTP | other *** search
/ Safarir 3 / SafTV-CD3.iso / pc / Bonus / Dessins Animés / static / jeux / napman.swf / scripts / frame_332 / DoAction.as
Text File  |  2001-11-21  |  2KB  |  104 lines

  1. if(mangiato1 == "0")
  2. {
  3.    px4 = int(f1x / "4");
  4.    py4 = int(f1y / "4");
  5.    restox = f1x - px4 * "4";
  6.    restoy = f1y - py4 * "4";
  7.    if(restox == "0" and restoy == "0")
  8.    {
  9.       x = f1x;
  10.       y = f1y;
  11.       call("evaluate");
  12.       xv = f1vx;
  13.       yv = f1vy;
  14.       call("controlla");
  15.       if(ok == "1")
  16.       {
  17.          f1vx = xvs;
  18.          f1vy = yvs;
  19.          call("ruotafan");
  20.       }
  21.    }
  22.    setProperty("/f1", _X, f1x * "4" + "8");
  23.    setProperty("/f1", _Y, f1y * "4" + "8");
  24.    if(f1vx == "1")
  25.    {
  26.       pros = "3";
  27.    }
  28.    else
  29.    {
  30.       pros = "0";
  31.    }
  32.    if(f1vy == "1")
  33.    {
  34.       prosy = "3";
  35.    }
  36.    else
  37.    {
  38.       prosy = "0";
  39.    }
  40.    tpx = f1x + f1vx + pros;
  41.    tpy = f1y + f1vy + prosy;
  42.    cosa = eval("r" add int(tpy / "4")).substr(int(tpx / "4") + "1","1");
  43.    if(cosa ne "X" and cosa ne "T" and cosa ne "R")
  44.    {
  45.       f1x += f1vx;
  46.       f1y += f1vy;
  47.    }
  48.    else
  49.    {
  50.       x = f1x;
  51.       y = f1y;
  52.       call("evaluate");
  53.       f1vx = xvs;
  54.       f1vy = yvs;
  55.       call("ruotafan");
  56.    }
  57.    if((px - f1x) * (px - f1x) < "9" and (py - f1y) * (py - f1y) < "9")
  58.    {
  59.       if(status == "1")
  60.       {
  61.          score += "100";
  62.          mangiato1 = "1";
  63.          tellTarget("/f1")
  64.          {
  65.             gotoAndStop(9);
  66.          }
  67.          tellTarget("/suoni")
  68.          {
  69.             gotoAndStop("magna");
  70.             play();
  71.          }
  72.       }
  73.       else
  74.       {
  75.          gameover = "1";
  76.       }
  77.    }
  78. }
  79. else
  80. {
  81.    if(f1y < "56")
  82.    {
  83.       f1y += "1";
  84.    }
  85.    if("56" < f1y)
  86.    {
  87.       f1y -= "1";
  88.    }
  89.    if("56" < f1x)
  90.    {
  91.       f1x -= "1";
  92.    }
  93.    if(f1x < "56")
  94.    {
  95.       f1x += "1";
  96.    }
  97.    setProperty("/f1", _X, f1x * "4" + "8");
  98.    setProperty("/f1", _Y, f1y * "4" + "8");
  99.    if(f1y == "56" and f1x == "56")
  100.    {
  101.       mangiato1 = "0";
  102.    }
  103. }
  104.